package com.singularity.onelabel.start;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.singularity.onelabel.MainActivity;
import com.singularity.onelabel.R;

/**
 * Created by Lenovo on 2018/11/13.
 */

public class StartActivity extends AppCompatActivity{

    // 正常启动图要展示的图片
    private ImageView startImg;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);

        initView();
    }

    // 初始化View
    private void initView() {
        startImg = findViewById(R.id.start_img);
        startImg.setImageResource(R.mipmap.ic_start_img);
        goMain();
    }

    // 倒计时3秒之后跳转到首页
    private void goMain() {
        new CountDownTimer(3*1000,1000){
            @Override
            public void onTick(long l) {

            }
            @Override
            public void onFinish() {
                Intent intent = new Intent(StartActivity.this, MainActivity.class);
                startActivity(intent);
            }
        }.start();
    }


}
